<section class="content-header">
  <ol class="breadcrumb">
    <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
    <li><a ui-sref="internal">境内注册业务</a></li>
    <li class="active" ng-bind="current_bread"></li>
  </ol>
</section>
<section class="content">
  <form class="form-horizontal" id="internal_form" style="margin-bottom: 100px;">
    <div class="detail-view-header-wrapper">
      <div class="box-footer detail-view-header" ui-scrollpoint ui-scrollpoint-enabled="true" ui-scrollpoint-class="fixed">
        <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
        <button type="button" class="btn btn-info" ng-click="save()">保存</button>
      </div>
    </div>
    <div class="box box-danger" ng-if="action=='add'">
      <div class="box-header with-border">
        <h3 class="box-title">旧数据迁移</h3>
        <div class="box-tools">
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="box-body">
        <div class="form-group">
          <label class="col-sm-2 control-label">是否为旧订单<span class="required">*</span></label>
          <div class="col-sm-8">
            <select class="form-control select2" name="is_old" ng-model="data.is_old" data-rule="required;">
              <option value="">请选择</option>
              <option value="1">旧数据迁移</option>
              <option value="0">新订单</option>
            </select>
          </div>
        </div>
        <div ng-if="data.is_old == 1">
          <div class="form-group">
            <label class="col-sm-2 control-label">订单完成日期</label>
            <div class="col-sm-8">
              <input type="text" class="form-control date-input" id="date_finish" name="date_finish" ng-model="data.date_finish">
            </div>
          </div>
        </div>
        <div class="form-group" ng-if="data.is_old == 1">
          <label class="col-sm-2 control-label">本年度是否已年检<span class="required">*</span></label>
          <div class="col-sm-8">
            <select class="form-control select2" name="is_already_annual" ng-model="data.is_already_annual" data-rule="required;">
              <option value="">请选择</option>
              <option value="1">已年检</option>
              <option value="0">未年检</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">字段说明</label>
          <div class="col-sm-8">
            <p style="line-height: 34px;">
              <span style="color: #217f50; font-weight: bold;">是否为旧订单:</span> 旧的订单数据迁移到该系统时，请选择“旧数据迁移”，旧数据迁移不走审核数据。录入完成后即属于完成的订单
            </p>
          </div>
        </div>
      </div>
    </div>
    <div class="box box-danger">
      <div class="box-header with-border">
        <h3 class="box-title">客户基本信息</h3>
        <div class="box-tools">
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="box-body">
        <div class="form-group">
          <label class="col-sm-2 control-label">客户名称<span class="required">*</span></label>
          <div class="col-sm-8">
            <select ui-select2 class="form-control select2" id="customerSelect2" name="customer_id" ng-view="customer_name" ng-model="data.customer_id" data-formatfields="code,text" data-formatcaptions="编号,名称" data-rule="required;" url="Customer/SearchForDropdown" paging="true" style="width: 100%;"></select>
            <span id="customerSelect2-validator" class="select-validator"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">行业类别</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.industry" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">所属省</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.province" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">所属市</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.city" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">所属县</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.county" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">地址</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.customer_address" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">联系人</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.contact" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">手机</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.mobile" disabled>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">座机</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" ng-model="data.tel" disabled>
          </div>
        </div>
      </div>
    </div>

    <div class="nav-tabs-custom">
      <ul class="nav nav-tabs">
        <li ng-class="{'active': activeTab == 0}"><a data-toggle="tab"  ng-click="onTab(0)">注册信息</a></li>
        <li ng-class="{'active': activeTab == 1}"><a data-toggle="tab" ng-click="onTab(1)">股东及股份</a></li>
        <!-- <li ng-class="{'active': activeTab == 2}"><a data-toggle="tab" ng-click="onTab(2)">监事信息</a></li> -->
        <li ng-class="{'active': activeTab == 3}"><a data-toggle="tab" ng-click="onTab(3)">委托事项</a></li>
        <li ng-class="{'active': activeTab == 4}"><a data-toggle="tab" ng-click="onTab(4)">开票信息</a></li>
        <li ng-class="{'active': activeTab == 5}"><a data-toggle="tab" ng-click="onTab(5)">其他</a></li>
      </ul>
      <div class="tab-content">
        <!-- 注册信息 -->
        <div class="tab-pane" ng-class="{'active': activeTab == 0}">
          <div class="form-group" ng-if="data.is_old != 1">
            <label class="col-sm-2 control-label">档案号<span class="required">*</span></label>
            <div class="col-sm-8">
              <input type="text" class="form-control" ng-model="data.code" placeholder="系统自动生成" readonly>
            </div>
          </div>
          <div class="form-group" ng-if="data.is_old == 1">
            <label class="col-sm-2 control-label">档案号<span class="required">*</span></label>
            <div class="col-sm-8">
              <input type="text" class="form-control" ng-model="data.code" name="code" data-rule="required;code;" placeholder="区域代码+订单代码+流水号">
            </div>
          </div>
          <div class="form-group" ng-repeat="item in data.nameList">
            <label class="col-sm-2 control-label" ng-bind="$index==0 ? '公司名称' : ''"><span class="required">*</span></label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="name{{$index}}" ref="name_input" ng-model="item.name" data-rule="required; length[~100];">
            </div>
            <div class="col-sm-2 add-dictionary" ng-if="data.nameList.length > 1">
              <a class="glyphicon glyphicon-trash" ng-click="removeName($index)" title="删除" style="color: red;font-size: 18px;"></a>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-8">
              <a class="glyphicon glyphicon-plus" style="cursor: pointer;"  ng-click="addName()">添加备选名称</a>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">注册地址</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="address" ng-model="data.address" data-rule="length[~300];">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">经营地址</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="biz_address" ng-model="data.biz_address" data-rule="length[~300];">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">公司法人</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="legal" ng-model="data.legal" data-rule="length[~20];">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">身份证号码</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="card_no" ng-model="data.card_no" data-rule="length[~30];">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">公司监事</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="director" ng-model="data.director" data-rule="length[~100];">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">监事身份证号码</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="director_card_no" ng-model="data.director_card_no" data-rule="length[~30];">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">注册资本</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="capital" ng-model="data.capital" data-rule-money="[/^(([1-9]\d{0,9})|0)(\.\d{1,2})?$/, '请填写2位数的数值']" data-rule="money;">
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">经营范围</label>
            <div class="col-sm-8">
              <textarea class="form-control" rows="3" name="scope" ng-model="data.scope"></textarea>
            </div>
          </div>

          <div ng-if="data.is_old == 1 || data.is_annual == 1">
            <div class="form-group">
              <label class="col-sm-2 control-label">公司成立日期<span class="required">*</span></label>
              <div class="col-sm-8">
                <input type="text" class="form-control date-input" id="date_setup" name="date_setup" ng-model="data.date_setup" data-rule="required;">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">统一信用编号</label>
              <div class="col-sm-8">
                <input type="text" class="form-control" name="reg_no" ng-model="data.reg_no" data-rule="length[~100];">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">纳税人资格</label>
              <div class="col-sm-8">
                <select ui-select2 class="form-control select2" name="taxpayer" ng-model="data.taxpayer" url="Dictionary/DroplistByGroup" paging="false" paramfield="group" paramvalue="纳税人资格"></select>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">是否海关备案</label>
              <div class="col-sm-8">
                <input type="checkbox" name="is_customs" ng-true-value="1" ng-false-value="0" ng-model="data.is_customs">
              </div>
            </div>
            <div class="form-group" ng-show="data.is_customs==1">
              <label class="col-sm-2 control-label">海关备案英文名称</label>
              <div class="col-sm-8">
                <input type="text" class="form-control" ng-model="data.customs_name" data-rule="length[~300];">
              </div>
            </div>
            <div class="form-group" ng-show="data.is_customs==1">
              <label class="col-sm-2 control-label">海关备案英文地址</label>
              <div class="col-sm-8">
                <input type="text" class="form-control" ng-model="data.customs_address" data-rule="length[~300];">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">是否在我司代理记账</label>
              <div class="col-sm-8">
                <input type="checkbox" name="is_bookkeeping" ng-true-value="1" ng-false-value="0" ng-model="data.is_bookkeeping">
              </div>
            </div>
            <div class="form-group" ng-show="data.is_bookkeeping==1">
              <label class="col-sm-2 control-label">代理记账费用</label>
              <div class="col-sm-8">
                <input type="text" class="form-control" name="amount_bookkeeping" ng-model="data.amount_bookkeeping" data-rule-money="[/^(([1-9]\d{0,9})|0)(\.\d{1,2})?$/, '请填写2位数的数值']" data-rule="money;">
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">开户行</label>
              <div class="col-sm-8">
                <select class="form-control select2" id="customerBankSelect2" name="bank_id" ng-view="bank_name" ng-model="data.bank_id" style="width: 100%;"></select>
              </div>
              <div class="col-sm-1 add-dictionary">
                <a class="fa fa-plus" ng-click="addBank()"></a>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">成交日期</label>
            <div class="col-sm-8">
              <input type="text" class="form-control date-input" id="date_transaction" name="date_transaction" ng-model="data.date_transaction" data-rule="">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">其他事项</label>
            <div class="col-sm-8">
              <textarea class="form-control" rows="3" name="description" ng-model="data.description" data-rule="length[~100];"></textarea>
            </div>
          </div>
        </div>
        <!-- 公司股东 -->
        <div class="tab-pane" ng-class="{'active': activeTab == 1}">
          <table class="table table-hover">
            <tbody>
              <tr>
                <th style="width: 10px">#</th>
                <th>姓名</th>
                <th>性别</th>
                <th>身份证号码</th>
                <th>股份比例(%)</th>
                <th>担任职务</th>
                <th class="opt-col">操作</th>
              </tr>
              <tr ng-repeat="item in data.shareholderList">
                <td ng-bind="($index+1)+'.'"></td>
                <td ng-bind="item.name"></td>
                <td ng-bind="item.gender"></td>
                <td ng-bind="item.cardNo"></td>
                <td ng-bind="item.takes"></td>
                <td ng-bind="item.position"></td>
                <td class="opt-col">
                  <a href="javascript:;" class="fa fa-pencil orange" ng-click="editShareholder($index, item)" title="修改"></a>
                  <a href="javascript:;" class="fa fa-trash-o red" ng-click="deleteShareholder($index, item)" title="删除"></a>
                </td>
              </tr>
            </tbody>
          </table>
          <div class="box-footer clearfix">
            <button type="button" class="btn btn-info" ui-sref=".shareholder_add()" ui-sref-opts="{location:false}">新增</button>
          </div>
        </div>

        <!-- 公司监事 -->
        <!-- <div class="tab-pane" ng-class="{'active': activeTab == 2}" style="padding-bottom: 50px;">
          <table class="table table-hover">
            <tbody>
              <tr>
                <th style="width: 10px">#</th>
                <th>姓名</th>
                <th>性别</th>
                <th>身份证号码</th>
                <th class="opt-col">操作</th>
              </tr>
              <tr ng-repeat="item in data.directorList">
                <td ng-bind="($index+1)+'.'"></td>
                <td ng-bind="item.name"></td>
                <td ng-bind="item.gender"></td>
                <td ng-bind="item.cardNo"></td>
                <td class="opt-col">
                  <a href="javascript:;" class="fa fa-pencil orange" ng-click="editDirector($index, item)" title="修改"></a>
                  <a href="javascript:;" class="fa fa-trash-o red" ng-click="deleteDirector($index, item)" title="删除"></a>
                </td>
              </tr>
            </tbody>
          </table>
          <div class="box-footer clearfix">
            <button type="button" class="btn btn-info" ui-sref=".director_add()" ui-sref-opts="{location:false}">新增</button>
          </div>
        </div> -->

        <!-- 委托事项 -->
        <div class="tab-pane" ng-class="{'active': activeTab == 3}">
          <table class="table table-hover">
            <tbody>
              <tr>
                <th style="width: 10px">#</th>
                <th>名称</th>
                <th>所需资料</th>
                <th>办理时间</th>
                <th>收费标准</th>
                <th>备注</th>
                <th class="opt-col">操作</th>
              </tr>
              <tr ng-repeat="item in priceList">
                <td ng-bind="($index+1)+'.'"></td>
                <td ng-bind="item.name"></td>
                <td ng-bind="item.material"></td>
                <td ng-bind="item.spend"></td>
                <td ng-bind="item.price"></td>
                <td ng-bind="item.memo"></td>
                <td class="opt-col">
                  <a href="javascript:;" class="fa fa-pencil orange" ng-click="editRegItem($index, item)" title="修改"></a>
                  <a href="javascript:;" class="fa fa-trash-o red" ng-click="deleteRegItem($index, item)" title="删除"></a>
                </td>
              </tr>
              <tr ng-if="priceList.length > 0" style="background: #ddd;">
                <td></td>
                <td>合计：</td>
                <td></td>
                <td></td>
                <td ng-bind="getTotal()"></td>
                <td></td>
                <td></td>
              </tr>
            </tbody>
          </table>
          <div class="box-footer clearfix">
            <button type="button" class="btn btn-info" ui-sref=".item_add()" ui-sref-opts="{location:false}">新增</button>
          </div>
        </div>
        <!-- 开票信息 -->
        <div class="tab-pane" ng-class="{'active': activeTab == 4}">
          <div class="form-group">
            <label class="col-sm-2 control-label">名称</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="invoice_name" ng-model="data.invoice_name">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">纳税人识别号</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="invoice_tax" ng-model="data.invoice_tax">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">地址</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="invoice_address" ng-model="data.invoice_address">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">电话</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="invoice_tel" ng-model="data.invoice_tel">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">开户行</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="invoice_bank" ng-model="data.invoice_bank">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">开户行账号</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="invoice_account" ng-model="data.invoice_account">
            </div>
          </div>
        </div>
        <!-- 其他 -->
        <div class="tab-pane" ng-class="{'active': activeTab == 5}">
          <div class="form-group">
            <label class="col-sm-2 control-label">客户归属<span class="required">*</span></label>
            <div class="col-sm-8">
              <input type="text" class="form-control" ng-model="data.salesman" disabled>

              <!-- <select ui-select2 class="form-control select2" id="salesmanSelect2" name="salesman_id" ng-view="salesman" ng-model="data.salesman_id" data-rule="required;" url=" Member/List" paging="true" style="width: 100%;"></select> -->
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">订单归属</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" ng-model="data.creator" disabled>
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-2 control-label">渠道商</label>
            <div class="col-sm-8">
              <select
                ui-select2
                class="form-control select2"
                id="traderSelect2"
                name="trader_id"
                ng-view="trader_name"
                ng-model="data.trader_id"
                data-formatfields="code,text"
                data-formatcaptions="编号,名称"
                url="Customer/SearchForDropdown"
                paging="true"
                style="width: 100%;"
                readonly
              ></select>
              <span id="traderSelect2-validator" class="select-validator"></span>
            </div>
          </div>


          <div class="form-group">
            <label class="col-sm-2 control-label">助理</label>
            <div class="col-sm-8">
              <select ui-select2 class="form-control select2" id="assistantSelect2" name="assistant_id" allowclear="true"  ng-view="assistant_name" ng-model="data.assistant_id" url=" Member/List" paging="true" style="width: 100%;"></select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">经理</label>
            <div class="col-sm-8">
              <select ui-select2 class="form-control select2" id="waiterSelect2" name="manager_id" allowclear="true" ng-view="manager_name" ng-model="data.manager_id" url=" Member/List" paging="true" style="width: 100%;"></select>
            </div>
          </div>
        </div>
      </div>
    </div>
  </form>
</section>
<div ui-view="modal"></div>
<div ui-view="bank"></div>
<div ui-view="shareholder"></div>
<div ui-view="internal_item"></div>
